<button mat-button [matMenuTriggerFor]="menu" #menuTrigger>Menu</button>
<mat-menu #menu="matMenu">
  <button mat-menu-item (click)="openDialog()">Open dialog</button>
</mat-menu>
